package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CreateACollectionContainingTheGivenNumberOfRandomIntegers {
	public static void main(String[] argv) {
		int size = 2;
		System.out.println(newRandomIntegerList(size));
	}

	private static final Random RANDOM = new Random();


	private static Collection<Integer> newRandomIntegerList(int size) {
		Collection<Integer> integers = new ArrayList<Integer>(size);
		for (int i = 0; i < size; i++) {
			integers.add(RANDOM.nextInt());
		}

		return integers;
	}
}
